﻿#ifndef CONNETIONSTTINGS_H
#define CONNETIONSTTINGS_H

#include <QDialog>
#include <QSerialPort>
#include "serialmanager.h"

namespace Ui
{
    class ConnetionSttings;
}

class ConnetionSttings : public QDialog
{
    Q_OBJECT

public:
    explicit ConnetionSttings(QWidget* parent = nullptr);
    ~ConnetionSttings();

public:
    //提供对外的接口（备用）
    portSettings getSetting()  const;

signals:
    void signalSerialConfigUpdatad(const portSettings& portSetting);
    void signalSerialConfigStop();

private slots:
    void refreshPortLists();
    void applySetting2Connect();
    void StopConnnection();



private:
    void populatePorts();
    void populateBaudRates();
    void populateDataBits();
    void populateStopBits();
    void populateParity();
    void populateResponseTime();

    portSettings portSetting;

    Ui::ConnetionSttings* ui;
};

#endif // CONNETIONSTTINGS_H
